﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AttentenceCheckSystem
{
    class common
    {
        public static DateTime GetCheckStartDate(DateTime value)
        {
            if (value.Day >= 16 && value.Day <= 31)
            {
                return new DateTime(value.Year, value.Month, 16);
            }
            else
            {
                return (new DateTime(value.Year, value.Month, 16)).AddMonths(-1);
            }
        }

        public static DateTime GetCheckEndDate(DateTime value)
        {
            return GetCheckStartDate(value).AddMonths(1).AddDays(-1);
        }
    }
}
